﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>datepicker</title>
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css">
    <link href="/open/bootstrap-datepicker/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <div class="col-lg-1"></div>
    <div class="col-lg-3">
        <div class="input-group">
            <span class="input-group-addon">时间</span><input type="text" class="form-control lot-time" placeholder="请选择时间...">
        </div>
        <button id="btn">获取时间</button>
    </div>
    <script src="http://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
    <script src="/open/bootstrap-datepicker/bootstrap-datetimepicker.min.js"></script>
    <script src="/open/bootstrap-datepicker/bootstrap-datetimepicker.zh-CN.js"></script>
    <script type="text/javascript">
        //时间控件
        $(function () {
            $('.lot-time').datetimepicker({
                format: "yyyy-mm-dd hh:ii",
                todayBtn: "linked",
                language: "zh-CN",
                autoclose: true
            });
        });
        $('#btn').click(function () {
            console.log($('.lot-time').val());
        });
    </script>
</body>
</html>